linux nginx 301跳转端口丢了

葫芦的运维日志

下一篇 搜索 上一篇

浏览量 2095

2015/12/09 15:16


在外层有端口映射设备,映射到后端nginx代理 再行跳转端口丢失时,在$http_host后增加端口

在proxy_set_header $http_host:13388 后增加PORT 13388


 listen 80 default_server;
    location / {
        proxy_pass http://127.0.0.1;
        proxy_set_header Host             $http_host;(或者使用:$host:13388)
        proxy_set_header X-Real-IP        $remote_addr;  
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

葫芦的运维日志

打赏

上一篇 搜索 下一篇
© 冰糖葫芦甜(bthlt.com) 2021 王梓打赏联系方式 陕ICP备17005322号-1